package br.ufrj.dcc.comp2.musica.vista;
import java.awt.Component;
import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;

import javax.swing.JButton;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JPasswordField;


public class PainelAlterarSenha extends JPanel {
	private static final long serialVersionUID = 1L;
	
	private JLabel labelUsuario = new JLabel("Para alterar a sua senha preencha os campos abaixo");
	
	private JLabel labelSenhaAtual = new JLabel("Digite a Senha Atual:");

	private JLabel labelNovaSenha = new JLabel("Digite a Nova Senha:");

	private JLabel labelConfirmaNovaSenha = new JLabel("Confirme a Nova Senha:");

	private JPasswordField campoSenhaAtual = new JPasswordField(10);

	private JPasswordField campoNovaSenha = new JPasswordField(10);

	private JPasswordField campoConfirmaNovaSenha = new JPasswordField(10);

	private JButton botaoAlterar = new JButton("Alterar");

	private JButton botaoCancelar = new JButton("Cancelar");

	GridBagLayout gridBagLayout = new GridBagLayout();

	GridBagConstraints gridBagConstraints = new GridBagConstraints();

	public PainelAlterarSenha() {
		setLayout(gridBagLayout);
		
		adicionar(labelUsuario, 1, 0);
		adicionar(labelSenhaAtual, 1, 1);
		adicionar(labelNovaSenha, 1, 2);
		adicionar(labelConfirmaNovaSenha, 1, 3);
		
		adicionar(campoSenhaAtual, 2, 1);
		adicionar(campoNovaSenha, 2, 2);
		adicionar(campoConfirmaNovaSenha, 2, 3);
		
		adicionar(botaoAlterar, 1, 4, GridBagConstraints.CENTER);
		adicionar(botaoCancelar, 2, 4,GridBagConstraints.CENTER);
	}
	
	public void adicionar(Component c, int x, int y) {
		gridBagConstraints.fill = GridBagConstraints.HORIZONTAL;
		gridBagConstraints.gridx = x;
		gridBagConstraints.gridy = y;
		gridBagConstraints.ipady = 3;
		
		add(c, gridBagConstraints);
	}
	
	public void adicionar(Component c, int x, int y, int fill) {
		gridBagConstraints.fill = fill;
		gridBagConstraints.gridx = x;
		gridBagConstraints.gridy = y;
		gridBagConstraints.ipady = 3;
		
		add(c, gridBagConstraints);
	}

}